
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>充值</title>
    <script src="js/rem.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="css/mui/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/recharge.css"/>
    <style type="text/css">
        .mui-icon-left-nav, #header {
            display: block !important;
        }
    </style>
    <script type="text/javascript">
        
                                   
                                   //IOS
                                   function pay('阐述a','参数B'){
                                       
                                   }
    
        </script>
</head>
<body>
<header id="header" class="mui-bar mui-bar-nav">
    <a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.back()"></a>
    <h1 class="mui-title" style=" font-size: 0.4rem;">充值</h1>
</header>
<div style="width: 100%;margin-top: .88rem;">
    <div id="userPhone">
        充值账号：<span class="phone" key="mobile">15288354367</span>
    </div>
    <div class="chooseMon">选择充值金额</div>
    <div class="amount">
        <ul>
            <li value="0.1">0.1元</li>
            <li value="100" style="margin-left: .3rem;">100元</li>
            <li value="200" style="margin-left: .3rem;">200元</li>
            <li value="500">500元</li>
            <li value="1000" style="margin-left: .3rem;">1000元</li>
            <li value="2000" style="margin-left: .3rem;">2000元</li>
        </ul>
    </div>
</div>
<div class="mask">

</div>
<div class="rehcargeType">
    <div class="type1">选择支付金额：<span></span></div>
    <div class="type2">选择支付方式</div>
    <div class="type3 choose change" value="weixin"><img src="image/wx-pay.png"/><span>微信支付</span></div>
    <div class="type4 choose" value="alipay"><img src="image/ali-pay.png"/><span>支付宝支付</span></div>
    <div class="gopay" onclick="chongzhi()">立即支付</div>
    <div class="close"></div>
</div>
</body>
<script src="js/jquery-1.10.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/mui/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    var amount = 50;
    $(function () {
        var recharge = {
            init: function () {
                $('.amount ul li').on('click', function () {
                    $('.mask').show();
                    $('.rehcargeType').show();
                    $('.type1 span').html($(this).html());
                    amount = $(this).attr('value');
                })
                $('.close').on('click', function () {
                    $('.mask').hide();
                    $('.rehcargeType').hide();
                })
                $('.choose').on('click', function () {
                    if (!$(this).hasClass('change')) {
                        $('.choose').removeClass('change')
                        $(this).addClass('change')
                    }
                })
                $('.gopay').on('click', function () {
                    // $('.mask').hide();
                    // $('.rehcargeType').hide();
                })
            }
        }
        recharge.init();
    })
    $(function () {
        $.ajax({
            url: BASE_URL + 'api/WebUser/0',
            success: function (data) {
                user = data;
                setValueByKey(data, 'text');
            }
        });
    })
   
   function payIOS(ss, abc){
       
   }
    function chongzhi() {
        alert('a');
        payIOS('abc','b');
        window.js.pay(data,payType);
        $('.choose').each(function () {
            if ($(this).hasClass('change')) {
                var payType = $(this).attr('value');
                $.ajax({
                    url: BASE_URL + 'AppPay/ToPay',
                    type:"post",
                    data: {payType: payType, amount: amount},
                    success: function (data) {
                        console.log(data);
                        window.js.pay(data,payType);
                    }
                })

            }

        })
    }
    function paycallback(status) {
        if (status == 0) {
            location.href = 'recharge-result.html';
        } else{
            mui.alert('支付失败', ' ', '我知道了', function () {
                //location.href = 'recharge-result.html';
            });

        }
    }
</script>
</html>
